package com.bawei.module_moto_circle.ui.post.detail

import com.bawei.module_moto_circle.http.MotoCircleApi
import com.bawei.module_moto_circle.http.MotoCircleNetModule
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject

/**
 *作者：lxy
 *功能:
 *时间：2025/6/4
 */
class PostDetailRepository @Inject constructor() {
    @Inject
    @MotoCircleNetModule.CommonMotoCircleApi
    lateinit var mApi: MotoCircleApi

    fun getPostById(postsId: String) = flow {
        emit(mApi.getByPostsId(postsId))
    }

    fun queryPostCommentsByPage(
        postId: String = "1905528400386129921",
        pageNum: Int,
        pageSize: Int = 10
    ) = flow {
        emit(mApi.queryPostCommentsByPage(pageNum, pageSize, postId))
    }

}